package com.lemner.ke.base;


import com.lemner.ke.bean.AboutBean;
import com.lemner.ke.bean.BlackListBean;
import com.lemner.ke.bean.CommentBean;
import com.lemner.ke.bean.ContentBean;
import com.lemner.ke.bean.ContentFailBean;
import com.lemner.ke.bean.LoginBean;
import com.lemner.ke.bean.RecommendBannerBean;
import com.lemner.ke.bean.RecommendBean;
import com.lemner.ke.bean.RichClassifyListBean;
import com.lemner.ke.bean.RichEntityBean;
import com.lemner.ke.bean.SuccessBean;
import com.lemner.ke.bean.SystemMsgBean;
import com.lemner.ke.bean.UserBean;
import com.lemner.ke.bean.VideoCloudBean;
import com.lemner.ke.bean.VideoCommentBean;
import com.lemner.ke.bean.VideoPlayBean;
import com.lemner.ke.bean.VideoRvBean;
import com.lemner.ke.bean.VideoTabRvBean;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

import static com.lemner.ke.base.URL.COLLECT_VIDEO;
import static com.lemner.ke.base.URL.GET_SYSTEM_MSG;
import static com.lemner.ke.base.URL.GET_VIDEO_CLOUD_ID;
import static com.lemner.ke.base.URL.GET_VIDEO_COMMENT;
import static com.lemner.ke.base.URL.GET_VIDEO_LIST;
import static com.lemner.ke.base.URL.GET_VIDEO_URL;
import static com.lemner.ke.base.URL.KNOWLEDGE_VIDEO;
import static com.lemner.ke.base.URL.NICE_VIDEO;
import static com.lemner.ke.base.URL.PUBLISH_VIDEO_COMMENT;
import static com.lemner.ke.base.URL.RECOMMENDBANNER;
import static com.lemner.ke.base.URL.RECOMMEND_LIST;
import static com.lemner.ke.base.URL.UNCOLLECT_VIDEO;
import static com.lemner.ke.base.URL.UNNICE_VIDEO;
import static com.lemner.ke.base.URL.about;
import static com.lemner.ke.base.URL.changePwd;
import static com.lemner.ke.base.URL.feedback;
import static com.lemner.ke.base.URL.getBlackList;
import static com.lemner.ke.base.URL.getEntityCollect;
import static com.lemner.ke.base.URL.getEntityList;
import static com.lemner.ke.base.URL.getEntityReadRecord;
import static com.lemner.ke.base.URL.getIdentifyingCode;
import static com.lemner.ke.base.URL.getRichEntity;
import static com.lemner.ke.base.URL.getUserByIds;
import static com.lemner.ke.base.URL.login;
import static com.lemner.ke.base.URL.loginMobile;
import static com.lemner.ke.base.URL.register;
import static com.lemner.ke.base.URL.report;
import static com.lemner.ke.base.URL.resetBirthday;
import static com.lemner.ke.base.URL.resetGender;
import static com.lemner.ke.base.URL.resetHead;
import static com.lemner.ke.base.URL.resetMobile;
import static com.lemner.ke.base.URL.resetNames;
import static com.lemner.ke.base.URL.resetPwd;
import static com.lemner.ke.base.URL.richClassifyList;
import static com.lemner.ke.base.URL.verifyPhone;

/**
 * 文件名：Service
 * 描  述：接口基类
 * 作  者：小烨
 * 时  间：2018.8.8
 */
public interface Service {
    /**
     * 登录
     */
    @POST(login)
    Call<BaseObjectBean<LoginBean>> login(@Query("mobile") String mobile, @Query("pswd") String pswd);

    /**
     * 验证码登录
     */
    @POST(loginMobile)
    Call<BaseObjectBean<LoginBean>> loginMobile(@Query("mobile") String mobile, @Query("identifyingCode") String identifyingCode);

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST(register)
    Call<BaseObjectBean<LoginBean>> register(@Query("mobile") String mobile, @Query("pswd") String pswd, @Field("names") String names);

    /**
     * 获取验证码
     */
    @POST(getIdentifyingCode)
    Call<SuccessBean> getIdentifyingCode(@Query("mobile") String mobile, @Query("type") String type);

    /**
     * 验证 验证码
     */
    @POST(verifyPhone)
    Call<SuccessBean> verifyPhone(@Query("mobile") String mobile, @Query("identifyingCode") String identifyingCode);

    /**
     * 获取知-推荐轮播图
     */
    @POST(RECOMMENDBANNER)
    Call<BaseListBean<RecommendBannerBean>> getBannerList(@Query("terminal") String terminal);

    /**
     * 获取知-推荐-最新知识
     */
    @POST(RECOMMEND_LIST)
    Call<BaseListBean<RecommendBean>> getRecommendList();


    /**
     * 获取知-视频
     */
    @POST(KNOWLEDGE_VIDEO)
    Call<BaseListBean<VideoRvBean>> getVideoList();

    /**
     * 根据视频分类ids获取视频列表
     */
    @POST(GET_VIDEO_LIST)
    Call<BaseObjectBean<BasePageBean<VideoTabRvBean>>> getVideoListByIds(@Query("pageNumber") int pageNumber,
                                                                         @Query("_query_classifyIds") String _query_classifyIds,
                                                                         @Query("orderColunm") String orderColunm,
                                                                         @Query("orderMode") String orderMode);

    /**
     * 根据视频ids获取cloudid
     */
    @POST(GET_VIDEO_CLOUD_ID)
    Call<BaseObjectBean<VideoCloudBean>> getVideoCloudId(@Query("ids") String ids, @Query("userIds") String userIds);

    /**
     * 根据cloudId获取视频播放地址
     */
    @POST(GET_VIDEO_URL)
    Call<VideoPlayBean> getVideoUrl(@Query("videoId") String videoId);

    /**
     * 获取视频评论
     */
    @POST(GET_VIDEO_COMMENT)
    Call<VideoCommentBean> getVideoComment(@Query("ids") String ids, @Query("pageNumber") int pageNumber);

    /**
     * 发表视频评论
     */
    @FormUrlEncoded
    @POST(PUBLISH_VIDEO_COMMENT)
    Call<BaseObjectBean<CommentBean>> publishComment(@Query("entityIds") String entityIds, @Field("content") String content,
                                                     @Query("userIds") String userIds, @Query("type") String type);

    /**
     * 视频点赞/取消点赞
     */
    @POST(NICE_VIDEO)
    Call<SuccessBean> niceVideo(@Query("entityIds") String entityIds, @Query("userIds") String userIds);

    @POST(UNNICE_VIDEO)
    Call<SuccessBean> unNiceVideo(@Query("entityIds") String entityIds, @Query("userIds") String userIds);


    /**
     * 收藏/取消收藏视频
     */
    @POST(COLLECT_VIDEO)
    Call<SuccessBean> collectVideo(@Query("entityIds") String entityIds, @Query("userIds") String userIds);

    @POST(UNCOLLECT_VIDEO)
    Call<SuccessBean> unCollectVideo(@Query("entityIds") String entityIds, @Query("userIds") String userIds);


    /**
     * 知识分类(接)
     */
    @POST(richClassifyList)
    Call<BaseListBean<RichClassifyListBean>> getRichClassifyList();

    /**
     * 获取知识列表(分页)
     */
    @FormUrlEncoded
    @POST(getEntityList)
    Call<BaseObjectBean<BasePageBean<RecommendBean>>> getEntityList(
            @Query("pageNumber") int pageNumber,
            @Query("_query_parentClassifyIds") String _query_parentClassifyIds,
            @Query("_query_classifyIds") String _query_classifyIds,
            @Field("_query_keywords") String _query_keywords,
            @Query("orderColunm") String orderColunm,
            @Query("orderMode") String orderMode);

    /**
     * 获取用户信息通过用户id
     */
    @POST(getUserByIds)
    Call<BaseObjectBean<UserBean>> getUserByIds(@Query("userIds") String userIds);

    /**
     * 重置昵称
     */
    @FormUrlEncoded
    @POST(resetNames)
    Call<SuccessBean> resetNames(@Query("userIds") String ids, @Query("mobile") String mobile, @Field("names") String names);

    /**
     * 重置性别
     */
    @POST(resetGender)
    Call<SuccessBean> resetGender(@Query("userIds") String ids, @Query("mobile") String mobile, @Query("gender") int gender);

    /**
     * 重置生日
     */
    @POST(resetBirthday)
    Call<SuccessBean> resetBirthday(@Query("userIds") String ids, @Query("mobile") String mobile, @Query("birthday") String birthday);

    /**
     * 重置头像
     */
    @Multipart
    @POST(resetHead)
    Call<SuccessBean> resetHead(@Part("userIds") RequestBody id, @Part MultipartBody.Part file);

    /**
     * 重置手机号
     */
    @POST(resetMobile)
    Call<SuccessBean> resetMobile(@Query("userIds") String ids, @Query("mobile") String mobile);

    /**
     * 重置密码
     */
    @POST(resetPwd)
    Call<SuccessBean> resetPwd(@Query("mobile") String mobile, @Query("pswd") String pswd);

    /**
     * 修改密码
     */
    @POST(changePwd)
    Call<SuccessBean> changePwd(@Query("userIds") String userIds, @Query("mobile") String mobile, @Query("oldpswd") String oldpswd, @Query("pswd") String pswd);

    /**
     * 获取收藏列表
     */
    @POST(getEntityCollect)
    Call<BaseObjectBean<BasePageBean<RecommendBean>>> getEntityCollect(@Query("userIds") String userIds, @Query("pageNumber") int page);

    /**
     * 意见反馈
     */
    @POST(feedback)
    Call<SuccessBean> feedback(@Query("userIds") String userIds, @Query("content") String content);

    /**
     * 关于我们
     */
    @POST(about)
    Call<BaseObjectBean<AboutBean>> about(@Query("terminal") String terminal, @Query("type") String type);

    /**
     * 浏览记录
     */
    @POST(getEntityReadRecord)
    Call<BaseObjectBean<BasePageBean<RecommendBean>>> getEntityReadRecord(@Query("userIds") String userIds, @Query("pageNumber") int page);

    /**
     * 获取黑名单
     */
    @POST(getBlackList)
    Call<BaseListBean<BlackListBean>> getBlackList(@Query("fromUserIds") String fromUserIds);

    /**
     * 获取知识内容
     */
    @POST(getRichEntity)
    Call<ContentBean<RichEntityBean>> getRichEntity(@Query("ids") String ids, @Query("userIds") String userIds);

    /**
     * 举报评论
     */
    @POST(report)
    Call<SuccessBean> report(@Query("ids") String ids, @Query("userIds") String userIds);

    /**
     * 获取系统消息
     */
    @POST(GET_SYSTEM_MSG)
    Call<SystemMsgBean> getSystemMsg(@Query("userIds") String userIds, @Query("pageNumber") int pageNumber);

    //失败方法
    @FormUrlEncoded
    @POST(register)
    Call<BaseObjectBean<String>> register2(@Query("mobile") String mobile, @Query("pswd") String pswd, @Field("names") String names);

    @POST(login)
    Call<BaseObjectBean<String>> login2(@Query("mobile") String mobile, @Query("pswd") String pswd);

    @POST(loginMobile)
    Call<BaseObjectBean<String>> loginMobile2(@Query("mobile") String mobile, @Query("identifyingCode") String identifyingCode);

    @POST(getRichEntity)
    Call<ContentFailBean<RichEntityBean>> getRichEntity2(@Query("ids") String ids, @Query("userIds") String userIds);
    //    新建model请写在失败方法上方
}
